﻿
using Xacml.Core;
using System;
using System.Xml;

namespace Xacml.Core.Policy
{
  public class PolicyCombinerParameterElement : CombinerParameterElement
  {
    private Uri _policyIdRef;

    public Uri PolicyIdRef
    {
      get
      {
        return this._policyIdRef;
      }
    }

    public PolicyCombinerParameterElement(string parameterName, AttributeValueElement attributeValue, Uri policyIdRef, XacmlVersion version)
      : base(parameterName, attributeValue, version)
    {
      this._policyIdRef = policyIdRef;
    }

    public PolicyCombinerParameterElement(XmlReader reader, XacmlVersion version)
      : base(reader, "PolicyCombinerParameterElement", version)
    {
    }

    protected override void AttributeFound(XmlReader reader)
    {
      if (!(reader.LocalName == "PolicyIdRef"))
        return;
      this._policyIdRef = new Uri(reader.GetAttribute("PolicyIdRef"));
    }
  }
}
